<?php
/*
 * estudo de padrões de projetos com php
 * author: fabricio s costa
 * version: 1.0
 * site: http://fabriciojf.com
 */

require_once('com/fabriciojf/action/Action.class.php');
require_once('com/fabriciojf/persistence/CategoriaDAO.class.php');
require_once('com/fabriciojf/persistence/PostDAO.class.php');
require_once('com/fabriciojf/security/Permission.class.php');

class EdicaoPostAction implements Action {

    public function execute() {
        Permission::requireInRole(array('admin'));

        $idPost = $_GET['idPost'] . $_POST['idPost'];
        
        $categoriaDao = new CategoriaDAO();
        $postDao = new PostDAO();

        $_REQUEST['categoriaDao'] = $categoriaDao->listAll();
        $_REQUEST['postDao'] = $postDao->findForId($idPost);


        require('com/fabriciojf/view/EdicaoPost.php');
    }

}
?>
